package com.jxdinfo.hussar.cloud.module.example.dljc.baskethistorycount.controller;

import com.jxdinfo.hussar.cloud.module.example.dljc.baskethistorycount.model.BasketHistoryCount;
import com.jxdinfo.hussar.cloud.module.example.dljc.baskethistorycount.service.BasketHistoryCountService;
import com.jxdinfo.hussar.cloud.module.example.dljc.baskethistorycount.vo.BasketHistoryCountSearchVO;
import com.jxdinfo.hussar.cloud.module.example.dljc.baskethistorycount.vo.BasketHistoryCountVO;
import com.jxdinfo.hussar.platform.core.base.apiresult.ApiResponse;
import com.jxdinfo.hussar.support.audit.core.annotations.AuditLog;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventGrade;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventType;
import com.jxdinfo.hussar.support.mp.base.controller.HussarBaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 吊篮历史统计控制器
 */
@RestController(value = "dljc.baskethistorycount.BasketHistoryCountController")
@AuditLog(moduleName = "吊篮历史统计")
@RequestMapping(value = "/dljc/basketHistoryCount")
public class BasketHistoryCountController extends HussarBaseController<BasketHistoryCount, BasketHistoryCountService> {

    private static final Logger logger = LoggerFactory.getLogger(BasketHistoryCountController.class);

    @Autowired
    private BasketHistoryCountService basketHistoryCountService;

    /**
     * 吊篮报警数量统计查询
     *
     * @param basketHistoryCountSearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "吊篮历史统计", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.INSERT)
    @PostMapping("findLine")
    public ApiResponse<List<BasketHistoryCountVO>> findLine(@RequestBody BasketHistoryCountSearchVO basketHistoryCountSearchVO) {
        //todo 没有获取项目编号工具类

        return basketHistoryCountService.findLine(basketHistoryCountSearchVO);
    }
}
